
import Request from "@/utils/http.js"
import {BASE_PATH} from "@/utils/config.js"
import {getStorage} from "@/utils/common.js"

// 获取用户列表
export const getUserList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/teacher/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取分类列表
export const getClassifyList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/classify/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获评论列表
export const getCommentList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/comment/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取一条评论
export const getCommentDetail = (id,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/comment/'+id,
			method:'GET',
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加评论
export const addComment = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/comment/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取关注列表
export const getFollowList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/follow/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加关注
export const addFollow = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/add/follow',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加问题
export const addQuestion = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/question/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 修改问题
export const editQuestion = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/question/edit',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取问题列表
export const getQuestionList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/question/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}
// 获取待专家回复的问题
export const getTeacherQaList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/teacher/qaList',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取问题详情
export const getQuestionDetail = (id,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/question/'+id,
			method:'get',
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取收藏列表
export const getCollectList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/collect/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加收藏
export const addCollect = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/collect/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加订单
export const addOrder = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/order/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取订单列表
export const getOrderList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/order/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取订教师服务订单
export const getTeacherOrderList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/teacher/service/order',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获取订单详情
export const getOrderDetail = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/order/detail',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加咨询包
export const addCoupon = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/coupon/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 咨询包列表
export const getCouponList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/coupon/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加咨询预约
export const addConsult = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/consult/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 咨询预约列表
export const getConsultList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/consult/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 公司列表
export const getCompanyList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/company/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加公司客户（公司）
export const addCustom = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/company/custom/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 新增公司
export const addCompany = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/company/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 咨询包使用情况
export const packageUseCount = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/package/use/count',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 根据某个公司获取该该公司的客户列表
export const getCustomList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/custom/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 确认服务完成
export const serviceOver = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/order/service/over',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 获爱好列表
export const getHobbyList = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/hobby/list',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 批量添加爱好
export const hobbyMany = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/hobby/insert-many',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 添加爱好
export const hobbyAdd = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/hobby/add',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}

// 删除爱好
export const hobbyDel = (params,callback)=>{ // 
	return new Promise((resolve,reject) =>{
		Request({
			url: '/boss/ask/hobby/del',
			method:'POST',
			data: params,
			success: res => {
				resolve(res)
				callback && callback(res);
			},
			fail: res => {
				resolve(res)
				callback && callback(res);
			}
		})
	})
}



